replace isinstanceof with isinstance