fixing date parsing bug