fix close bug