YOU are ignoring the indicator function

BESIDES TWO TYPOs (the i and the negative sign in front of theta)

THE MLE is the smallestorder stat.

YOU need to use common sense, not calculus (incorrectly)

to maximize the likelihood function

This is smallest, ZERO, when

while you want as large as possible WITH RESPECT TO THETA

So, you will need

so to make as large as possible

you want or as big as possible

and it CANNOT exceed the data, hence the MLE (is our sufficient statistic by the way)