@Override
    public void run() {

        while (!Thread.currentThread().isInterrupted()) {
            try {
                gamemodel.insertCellContent(gamemodel.getActualPlayer().getNextMove());
                gamemodel.setInvalid(false);
                gamemodel.changePlayer();
            } catch (InvalidMoveException ex) {
                gamemodel.setInvalid(true);
                gamemodel.notifyObservers();
                gamemodel.getActualPlayer().invalidMove();

            } catch (GameOverException ex) {
                gamemodel.getActualPlayer().youWin();

                if (gamemodel.getActualPlayer().equals(gamemodel.getPlayer1())) {
                    gamemodel.setLose(true);
                    gamemodel.notifyObservers();

                    gamemodel.getPlayer2().youLose();

                } else {
                    gamemodel.setWon(true);
                    gamemodel.notifyObservers();

                    gamemodel.getPlayer1().youLose();
                }
                break;
            } catch (DrawException ex) {
                gamemodel.setDraw(true);
                gamemodel.notifyObservers();
                gamemodel.getPlayer1().draw();
                gamemodel.getPlayer2().draw();
                break;
            }
        }

    }