fixed some time checking