Restructure server code
Fix the server code
Close connection gracefully on client side
Go to start menu when server disconnects