fixing some flow