added custom serialise functionality to Object