added endtime validation