properly deal with  dates