Close the opened directory