There was a ghosting door upstairs. Ghosting doors are doors open or close or both by themselves. A ghosting door is always out of adjustment. A ghosting door on the ground floor is usually out of adjustment due to foundation movement. When the door is upstairs, the cause is usually a framing irregularity or age or both. In any event foundation repair is not a reasonable response to a ghosting door. A less expensive and more effective correction is to remove each hinge pin and bend it slightly or roughen up the surface to create more friction.