@Override
	public void run() {
		while (!isStop) {
			try {
				Socket clientSocket = listener.accept();
	    		ServerHandler serverHandler = new ServerHandler(clientSocket, records);
	    		handlers.add(serverHandler);
	    		threadPool.start(serverHandler);
			} catch (IOException e) {
				System.out.println(e.getMessage());
				System.exit(1);
			}
		}
		
		if (!listener.isClosed()) {
    		try {
				listener.close();
			} catch (IOException e) {
				System.out.println(e.getMessage());
				System.exit(1);
			}
    	}

	}