Fixed a bug with datetime