added 500,504 error codes to retry logic