fix date handling