revised save method