do we need to call finish() before we return in the error cases also?