Fix time checking