fix bug with parallel flow