Fixing flow problem