functionality to add to database