make sure date fields are stored correctly