bugfix in saving