Fixed bug that did not add data to the database.