error check start and end times