changed the error handler res status