fixed the missing status code on the error handler