Fix copy/paste error. Do not set socket to null after closing it