fixed the wrong close