The worst noise you can hear during sex is probably the sound of a rifle being loaded by your jilted ex.

But the dreaded bedroom door creak is a close second—especially if the person on the other side of the door is your young, curious child.

By the time my friend Shawn and his wife could react to the terrifying sound, it was too late. Their 9-year-old son was already standing at the foot of their bed.

Shawn felt violated, and the only thing he could think to do was yell at his son. His scream was so loud that it jolted his startled wife right out of bed and on top of their kid.

“It probably wasn’t the best way to handle it,” Shawn admits.

Shawn’s awkward family experience isn’t unique.

Once, my toddler daughter walked in on my wife and me. We defused the situation by telling her we were wrestling, but it was embarrassing enough that I now barricade the door every time we have sex. (Luckily, this only happens four times a year thanks to my bad back.)

So what should you do if your own kids catch you in the act? Here are six smart ways to react.

1. Stay Cool

Hear a creak? Quickly cover up, but don’t freak. “If you panic, your child associates [your reaction] with something that shouldn’t be happening—and you don’t want to give them that idea about sex,” says Los Angeles-based psychologist Judy Rosenberg, Ph.D., author of Be the Cause: Healing Human Disconnect.

Stay calm, strategically place the sheets over your privates, and flash a smile. The more you show your kid that you accept sex, the healthier he’ll perceive it, Rosenberg says.

2. Wait For Their Reaction

Of course, there’s a good chance your child won’t even know what you’re doing. So before you prepare an excuse, wait to see how he or she reacts, says Rosenberg.

“Parents are so busy trying to be defensive that they forget that their kid could be thinking, ‘That’s really hysterical,’ or, ‘Mommy and daddy are horseback riding each other,” Rosenberg says.

Or maybe your kid is just hungry and wants a sandwich. “Shut up and see what he needs first,” says Rosenberg.

3. Make Something Up

Sex looks and sounds aggressive to someone who doesn’t know what it is, says Minnesota-based child psychologist Hal Pickett. So you need to tell your son or daughter that you were just having fun, Pickett says.

Pick any enjoyable activity and run with it: You were tickling mom. You were playing a new sport. You were searching for a magical treasure hidden somewhere on her body.

4. Explain Why You’re Naked

This is where you’ll have to be a little more creative. “If your child is visually exposed to particular body parts or curious about why you don’t have any clothes on, it’s important to give them information they can developmentally handle,” Pickett says.

His go-to line: “When we were finished tickling, Daddy needed to take a shower. So that’s why he was naked.”

5. Wait For Them to Leave In Horror

If your kid is old enough to understand sex, chances are he’ll run out of the room before you can grab your underwear. “He knows what you’re doing,” says Pickett, “and he’ll probably be as embarrassed as you are.”

But that doesn’t mean you should brush off the clumsy encounter. Sit down with your son or daughter the next day and offer up a simple explanation—not an elaborate sex-ed lesson.

Try something like, “Sex should be between two adults who love each other,” Pickett advises. Your kid will learn all the ins and outs later; for now, simply address the elephant in the room and move on.

6. Buy a Bedroom Lock and Remember to Use It

This tip didn’t come from a psychologist—just my friend Shawn.