fix flow bug