flatten lists during append step