Fix undefined local variable or method `search'