fix bugs on updating date and time