fix level=0 in children and change .fn.chain to .chain