Don't use __del__ but a close method, as del is not getting called