fix flow and add helper