Handle err before statusCode