Fixed bug for dates