solve index bug with subflows