set response status to 500 in the catch block