Fixed a bug with retries