Return status code 500 on error