implement better support for retries with custom keys