Those who have a peanut allergy are often told to avoid all tree nuts, but this may not be necessary, according to new research.

Scientists found that more than 50 percent of those who thought they were allergic to one nut and have also tested positive to other tree nuts were able to pass an oral food challenge. Tree nuts include, but are not limited to, almonds, cashews, walnuts, and hazelnuts. Contrary to popular belief, peanuts are legumes, not nuts.

Read: Peanut Allergies: Introduce Nut Early To Avoid Problems, New Guidelines Say​

The study participants took an oral food challenge, which is considered to be a highly accurate diagnostic test. Under medical supervision, the participants were fed small amounts of one type of nut every 15 to 20 minutes to see if there was a serious reaction, like hives or trouble breathing, TIME reported. Despite the participants testing positive for an allergy to a specific nut via blood test, many did not react during the challenge.

“Too often, people are told they’re allergic to tree nuts based on a blood or skin prick test,” lead study author and allergist Christopher Couch, said in a statement.

The subjects who did the oral food challenge only ate nuts that they had no history of allergic reaction to. This type of allergy test should always be conducted under the supervision of a board-certified allergist, in case a reaction occurs.

“After an oral food challenge, people allergic to a single tree nut may be able to include other nuts in their diet,” said study co-author and allergist Matthew Greenhawt.

The study, published in Annals of Allergy, Asthma and Immunology, included data from 109 patients’ medical records who had a known tree nut allergy to an individual nut.

About 3 million people in the United States report allergies to peanuts and tree nuts, according to Food Allergy Research and Education.

See also: Peanut Allergies Treatment 2016: Immunotherapy Shows Promise In New Study​

Peanut Allergy Relief? Hypoallergenic Peanuts May ‘Maintain The Nutrition And Functionality’ Of The Real Thing