added timeout and retries