improved error message for 500 error