Added a check for valid times.