hacked fix for saving groups and diagrams