Fixed bug with retry