Fixing bug with date time