Fixed bug where date was not being stored correctly in database.