Modified to correctly add items to table and update db when user uses the 'Add an item' form