public void startServer(){
        ServerSocket server=null;
        try {
            try{
                fetchUsers();
            }
            catch (FileManagerException e){
                FileManager.placeToLog(e.getMessage());
                users=new ConcurrentLinkedDeque<>();
            }
            server = new ServerSocket(PORT);
            server.setSoTimeout(TIMEOUT_DELAY);
            while(working){
                try{
                InteractionThread interactionThread = new InteractionThread(server.accept());
                interactionThread.start();
                }
                catch (SocketTimeoutException e) {
                    System.out.println("Timeout...");
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        finally {
            try {
                if (server!=null) server.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
            FileManager.saveUsersToFile(users);
        }
    }