check for 500 status before error checking