fixed it so that the program would not crash if you click an item you added