fix date issue if invalid date format