fix subtree directive bug that made first input copy value of current active one, if inside loop