added the ability to retry indefinitely. needs to have a max_retries