fix a datetime bug