handle incomplete/invalid search pattern properly