getting derivation undos working right