fixed saving bug