adding counter with retries