fixed a bug in date parsing