fix flow bug and presave bug