bug on time comparision with counter fixed