Fixed invalid reference to object variable