fix issue when no patterns are found