datetime related bug fixed