fix datetime bug