Fixed incorrect time check