Correct bug preventing search from working