fixing the flow