should have used close() method.