fix statement close bug