fixing bug with searching.