fix datetime issue