fix for level=0 and chnage .fn.chain to .chain