Move this to just after make_response (in the try block).