added first draft of retries logic