fixed enddate passing issue