fixed bug on changing dates