solved using metaclass