correct saving of subdefintions