fixing datetime problem