bug fix in datetime