Added configuration between connection between chains and flows, fixed bugs