add metaclass compat code