fixed some bugs with the date filter