Make selectedItem an instance variable