Implementing retry