Fix search box function