forgot to add retry logic at inner loop