metaclass fix for python 3