properly set start and end times