use type() rather than __class__