Datetime Bug fixing