detect the closed space.