fix to reward issue in undo