Left your keys on the kitchen counter again? No problem. Just go and get them. Walk through the house, into the kitchen, and—what was it you needed to do again? Why are you in here? In less than 30 seconds, you’ve managed to forget the entire purpose of your errand. But don’t worry. It’s not just you, and you’re not losing your marbles. It’s called the Doorway Effect, and it’s actually a sign that your brain is in fine working order.

Scientists used to believe that memory was like a filing cabinet. You have an experience, and it gets its own little file in your brain. Then, later, you can go back and open the file, which is unchanged and where it should be. It’s a nice, tidy image—but it’s wrong. Your brain is much more complicated and sophisticated than that. It’s more like a super-high-powered computer, with dozens of tasks and applications running at once.

A 2011 study found that the Doorway Effect is the result of several of these brain programs running simultaneously. Researchers taught 55 college students to play a computer game in which they moved through a virtual building, collecting and carrying objects from room to room. Every so often as the participants traversed the space, a picture of an object popped up on the screen. If the object shown was the one they were carrying or the one they had just put down, the participants clicked “Yes.” Sometimes these pictures appeared after the participant had walked into a room; other times they appeared while the participant was still in the middle of a room. The researchers then built a real-world version of the environment and ran the experiment again, using a box to hide the objects people were carrying so they couldn’t double-check.

The results of both trials were the same: The simple act of walking through a doorway made people forget what they were doing. And it wasn’t a matter of distance, either. The researchers asked the question (“Is this what you’re carrying?”) after people had walked a certain distance within a room, and a certain distance between rooms. Within a room, their memories remained mostly intact. But crossing a threshold was like shaking a mental Etch-a-Sketch.

The researchers concluded that their subjects’ brains perceived doorways as a kind of cut-off point. The memories and movement that carried the students through one context literally hit a wall. On the other side of that wall was new context, and a fresh landscape for memory. The participants’ mental computers were combining the tasks of spatial awareness, movement, and memory. But each task requires attention, and you can’t pay attention to everything at once.

Is there a way to avoid the Doorway Effect? Probably, although science hasn’t found it yet. If you’ve got a trick that works, let us know in the comments.