fixed bug where saving failed