fixed datetime bug