add startdate and enddate check logic