fixing invalid search