Fixed bug in retry