fixing bug in date