private void performAI_Move(EntityManager manager,
			HttpServletRequest request, String mobileHash, Game game,
			String move) throws Exception {
		EntityTransaction transaction = manager.getTransaction();

		if (!game.getCurrentPlayer().equals(mobileHash)) {
			throw new Exception("It is not your turn to move, Please wait for "
					+ game.getCurrentPlayer() + " Move");
		}
		ChessBoard board = game.reCreateBoard();
		board.performMove(Move.getMove(board, move));
		game.init(board);
		Result result = board.getResult();
		int level = TxtChessUtil.getAI_Level(game);
		switch (result.getStatus()) {
		case PROGRESS: {
			String aiMove = Service.getService().getServiceSoap()
					.getNextMove(game.getFEN(), "", level);
			board.performMove(Move.getMove(board, aiMove));
			game.init(board);
			result = board.getResult();
			if (result.getStatus() == Status.PROGRESS) {
				try {
					transaction.begin();
					manager.merge(game);
					transaction.commit();
				} catch (Exception e) {
					try {
						transaction.rollback();
					} catch (Exception ex) {
						ex.printStackTrace();
					}
					throw new Exception(
							"Ai is unable to perform it's move (Internal Error)",e);
				}
				setJspPath("/showGame");
				break;
			} else {
				// ai move ended the game, just follow next default case
			}

		}
		default: {
			GamesArchive g = new GamesArchive(game, result);
			try {
				manager.persist(g);
				transaction.begin();
				manager.remove(game);
				transaction.commit();
			} catch (Exception e) {
				try {
					transaction.rollback();
				} catch (Exception ex) {
					ex.printStackTrace();
				}
				throw new Exception(
						"Unable to perform the AI move (Internal Error)",e);
			}
			request.setAttribute(
					"__message",
					TxtChessUtil.getHeaderStatus(result, game.getWhite(),
							game.getBlack(), mobileHash, "AI Level " + level)
							+ "<br/><br/>"
							+ TxtChessUtil.getTxtChess(game.reCreateBoard(),
									manager.find(ChessUser.class, mobileHash))
							+ "<br/>");
			setJspPath("/jsp/common/MessageHandler.jsp");
			break;
		}

		}
	}