fixed checking time bug