Let $X1, \dots, Xn$ be a random sample of size n from the continuous distribution with pdf $f_X(x|\theta) = \frac{e^{-x}}{1-e^{-\theta}} I(x)_{[0,\theta]} I(\theta)_{(0, \infty)}$.
(1) Find the maximum likelihood estimator for $\theta$.
(2) Find the maximum likelihood estimator for the median,$\lambda$, of this distribution.
For (1), I got $X_{(n)}$ because I thought if $\theta$ was minimized, it would maximize the function.
For (2), I know I set up the distribution to solve for the value of the median. I think that once I find this value I will use it in relation to the MLE from (1) to find the MLE for(2). I got $m = ln(2) - ln(e^{-\theta} + 1)$ but this doesn't seem right and I amd not sure where I am messing up. Any assistance is greatly appreciated.