Used isinstance instead of issubclass.