fix the case when there are no matches.