fix date writing