serialize object with it's name