private synchronized void shutdown() {
        if (shutDown) {
            return;
        }
        System.out.println("file server shutting down.");
        try {
            threadPool.shutdown();
            if (!serverSocket.isClosed()) {
                serverSocket.close();
            }
            FileManager.getInstance().save();
            shutDown = true;
            //System.out.println("here!");
        } catch (Exception e) {
            System.err.println(e);
        }
    }