amend the prev commit and improve install_flows()