fixed bug in forEachChild()

Change-Id: Ia1d68f3ec6198e96bf5469a897100ea40756fea7