fixed bug that wouldn't reset retry count.