finish logic for adding new data to the db