Adding a customizable retry count.