Fix bug for flow with indexed data