fixing safari date handling issue