fixed parsing of datetime