Added retries as a parameter