fixed issue with subclass checking