Call to a member function getItem() on bool