fix empty datetime bug