Fixed early close bug