fixed an error with dates