add max retries in case of failure