public boolean changeNickname(String device, String newNickname,
			PersistentDeviceModel model) {

		boolean isChanged = false;

		for (Device dev : model.getDevices()) {
			if (dev.getName().equals(newNickname)
					&& !dev.getSerialNumber().equals(device)) {
				return false;
			}
		}
		if (devices.containsKey(device)) {
			devices.put(device, newNickname);
			isChanged = true;
		}

		return isChanged;
	}