datetime bug fix