Given a wealth process that evolves as $$d w_t = r w_t dt + \theta_t ( \sigma dW_t + (\mu-r) dt) - c_t dt.$$ where $\theta_t$ is the worth of holding at time $t$ and $c_t$ is the consumption stream.
Also, we define smooth functions $u,F: [0, +\infty) \rightarrow \mathbb{R}$.
How can we optimise the following:
$$V(w) = \sup_{c \geq 0, \, \theta, \, \tau} \mathbb{E} \bigg[ \int_0^{\tau} e^{- \rho t} u (c_t) dt + e^{-\rho \tau} F(w_{\tau}) \bigg| w_0 =w \bigg],$$ where $\tau$ is a stopping time.
The traditional method of using the HJB and martingale principle of optimal control does not seem to work in this case, when stopping time is involved.
Any suggestions on how to optimise this?