make serialize more robust for deep models with empty parts