Fixed close bug