fixing search so it would be correct