bugfix for saveing