implemented time validation