public String moveMessage() {
		if (selectedMessages2.length == 0) {
			FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error",
					"You have not selected messages to move"));
			return null;
		}

		if (selectedMessages2[0].getFolder() == endFolder.getId()) {
			FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error",
					"You have not changed selected messages folder"));
			return null;
		}

		try {
			messageService.moveMessage(selectedMessages2, endFolder);
			for (MessageDTO message : selectedMessages2) {
				listOfMessages.remove(message);
			}
			resetSelectedMessages();
			FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO,
					"Information","Messages successfully moved to another folder"));
			return null;
		} catch (DataProcessingException e) {
			FacesContext.getCurrentInstance().addMessage(null,
					new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error",e.getExceptionMessage()));
			return null;
		}
	}