Add checks against invalid search input