Please use ``isinstance`` to check the class here.