implemented to add to the database