fixed issue working with dates