fixed js date parsing error