Forgot to close socket
after closing cursors