fixed bug with retry