prevent typerror on invalid search