Use tries=inf and check for 500. Abort after 9000 tries.