add visit_with_retries method