closing socket after exiting to menu