-reconnects to server if server is open in main method when application
   is closed.

-not a bug to delete memory of server now