working serialization through metaclass