add missing check for proper class type