fix bug with dates