try to stop loop when count = 0