fixed save to do the right thing