added flatFold