Fixed MAX_RETRIES comparison operator from > to >=