Humans may have a built-in ability to stay committed in relationships, or at least have unconscious mechanisms that help them do so, according to a new study. Despite the fact that scientists have long argued that monogamy isn’t necessarily hard-wired within us, it turns out that our brains still work to keep us committed to a single partner once we’re in a relationship.

The study, conducted by researchers at Rutgers University and New York University, found that people in monogamous relationships had an unconscious way of viewing people whom they might otherwise typically find attractive as less good-looking. In a sense, immediately finding flaws in other objectively attractive people is like the brain’s defense mechanism to help people avoid temptation and stay satisfied in their relationships. In their abstract, the researchers note that “people defend their relationships against attractive individuals…by perceiving the individual as less attractive.”

“Misperceiving attractive people who represent threats to the relationships as less attractive may help people resist the inclination to pursue them,” said Dr. Shana Cole, an author of the study, in a statement. “This is especially important since finding someone physically attractive is a primary reason why people choose to date or romantically pursue someone.”

In their first experiment, the researchers gathered 131 participants who were heterosexual college students. They were shown images of a potential lab partner of the opposite sex, with whom they would be spending plenty of time. Each lab partner had a profile indicating whether they were single or in a relationship that the participants read. They were then asked to select one photo from a series of photos that had been manipulated to make the individual more attractive or less attractive that they felt matched the lab partner’s level of attractiveness. Participants who were in a relationship tended to match the original photo with the uglier version, suggesting they viewed potential threats as less attractive. Single people, meanwhile, had a tendency to see the lab partner as more attractive than they actually were. Interestingly, people in a relationship who learned their lab partner was also in a relationship, and perhaps less of a potential threat, viewed them as slightly more attractive as well.

In the second experiment, the researchers attempted to repeat the results by examining 114 students. The participants reported on how satisfied they were in their relationships, and they were asked to do the same as in the previous trial: identify a potential partner’s face by matching it with less or more attractive photos. The participants also learned whether this potential partner was interested in dating, or not.

The researchers found that people who were satisfied in their relationships saw others as less attractive, but those who were unhappy with their relationships experienced the opposite — outside people became more attractive, similar to how single people perceived them.

Scientists generally believe that humans are something of a “mid-way species” when it comes to faithfulness and monogamy. Some of us prefer to mate for life, while others see the benefits in sowing their seed, and in many cases, it’s not black and white. What makes us fall into one group or another could be a mix of environmental impact, our childhood emotional states, and even genetics. At times, it could be hard to believe that true faithfulness exists, especially since research has shown that evolutionarily being promiscuous has provided benefits in creating offspring, and that men may even be naturally hard-wired to ogle at other women.

Despite all the odds stacked against your monogamous relationship, however, the latest study — which is one of the first to focus on unconscious mechanisms in attraction/temptation — provides hope to those who want to stay committed. Even if your brain makes you look at other potential partners, it also provides itself with a quick defense mechanism to remind you that what you’ve got is golden.

“In today’s world, it can be difficult to stick it out with one long-term partner,” said Emily Balcetis, an author of the study, in the statement. “This work suggests that there are processes that may take place outside of conscious awareness to make it easier to stay committed to one’s own partner.”

Source: Cole S, Trope Y, Balcetis E. In the Eye of the Betrothed: Perceptual Downgrading of Attractive Alternative Romantic Partners. Personality and Social Psychology Bulletin , 2016.