bug fix in 'save' function for reactions (only in AD mode)