Made changes to fix storage of data into the database.