add flatten function attr. flattening.