If you’ve ever crossed your legs to match your best friend’s stance or leaned in close as your date did the same, you’ve experienced mirroring. Whether you realize you’re doing it or not, subtly mimicking people in social settings helps you form bonds and establish connections. Mirroring—copying a person’s looks, gestures and general body language—is especially handy on job interviews and dates when we’re trying to establish a rapport and develop trust.

While this unconscious activity has its benefits—imitation is the sincerest form of flattery, after all—new research reveals that unchecked mirroring can backfire.

The study, published in Psychological Science, found that when people were observed unconsciously mimicking someone who wasn’t perceived as friendly or likable, they were described as the same.

QUIZ: What’s Your Relationship Style?

“Mimicry is a crucial part of social intelligence,” says Piotr Winkielman, study co-author and professor of psychology at the University of California, San Diego, in a statement. “But it is not enough to simply know how to mimic. It’s also important to know when and when not to. The success of mirroring depends on mirroring the right people at the right time for the right reasons. Sometimes the socially intelligent thing to do is not to imitate.”But controlling the mirroring process isn’t so easy (case in point: mirroring may be part of the reason why yawning  is contagious). That’s because your brain is equipped with mirror neurons, which act like tiny, neurological video cameras that automatically make you want to copy a person’s actions, according to YouBeauty founder Dr. Michael Roizen. The neurons may not always differentiate between whose actions you should imitate—that cute guy you’re finally having coffee with—and those you shouldn’t—your manic-depressive boss.

AHA: Mirror Neurons Allow Us to Feel Empathy

“It’s good to have the capacity to mimic,” Winkielman says in a statement, “but an important part of social intelligence is knowing how to deploy this capacity in a selective, intelligent, context-dependent manner and understanding, even implicitly, when mirroring can reflect badly on you.”

The next time you find yourself in the presence of someone you find off-putting, take a moment to consciously check your body language and behavior. After all, you don’t want mirroring to reflect badly on you.