Fixing the double search bar issue with algorithms