Fixed segfault (we need to close it for it has referenced by somewhere)