I have no idea why this was here, I copied the code. I see no need in global ```retry_count``` here.
Anyway, I'll try to fix.