Fix: check existance of the instance before refering to member variable