Date format bug fix