Fix issue in time check