fixes to flow sink logic