fixed timing problem of c.count = 0