fixed bug where clicking delete would crash the app. also made new items get added to the database.