If you’ve ever walked into a room and forgotten why, a new study suggests the doorway may be to blame.

Across multiple experiments in both the real and virtual worlds, researchers from the University of Notre Dame found that exiting a door served as an “event boundary” in the mind. Like ending an old chapter and starting a new one, people’s memories appear to use doorways as a way of separating episodes of activity — thus making it challenging to recall an experience or decision made in the previous room, because the event has been filed away.

“The architecture of the world can actually impede your memory,” says study co-author Gabriel Radvansky, a professor of psychology. “The brain needs to be able to shift gears to what’s relevant now, and not focus on what’s irrelevant. Event boundaries help provide that structure.”

[np-related]

In the first experiment, participants moved around a virtual-reality environment with 55 rooms of varying sizes. Each room contained one or two tables from which they were asked to choose an object — which disappeared from view once it was “picked up” — and to exchange it for another object at a different table.

Memory tests were performed throughout, whether they’d exited a doorway or just crossed the room, to see if participants remembered the object in their hand. The researchers found that memories were diminished after walking through a doorway, compared with travelling the same distance within one room.

“It’s like if you’re in the living room and decide you want something in the kitchen, you walk into the kitchen and have absolutely no idea why you’re there,” says Radvansky.

“You see this in animals that are tracking things; when they move from one region to another, they kind of reset what they’re doing.”

A second experiment replicated the first study in a real-world setting, using boxes to hide the objects plucked from each table, and the doorway effect still held true. Radvansky explains that encountering the same object in two different places sets up a competition in the memory that subsequently causes difficulties with recall.

A final experiment tested whether the door was indeed an event boundary or rather if memory performance was linked to the environment itself. But even when participants passed through multiple doorways only to end up in their original room (where the memory of choosing the object was first created), recall saw no improvements.

Radvansky’s advice, offered somewhat tongue in cheek: “Doorways are bad. Avoid them at all costs.”