use instanceof check