Fixed multiple close bug