	public Object wrapper(int count, String methodName, Object... arguments){
		if (count > 5){
			System.out.println("Giving up after many tries!");
			return null;
		}
		Object result=null;
		try {
			Method method = getMethod(methodName);
			Object res =  method.invoke(askPort, arguments);
			Method error = res.getClass().getMethod("getError");
			if ( (Integer)error.invoke(res) == 101){
				this.startSession();
				res = method.invoke(askPort, arguments);
			}
			return res;
		} catch (IllegalArgumentException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (InvocationTargetException e) {
			if (e.getCause().getCause().getClass().getName().equals("java.net.SocketTimeoutException")){
				System.out.println("Timeout, re-trying "+count);
				return wrapper(count++,methodName,arguments);
			} else {
				e.printStackTrace();
			}
		} catch (SecurityException e) {
			e.printStackTrace();
		} catch (NoSuchMethodException e) {
			e.printStackTrace();
		}
		return result;
	}

	public Object wrapper(int count, String methodName, Object... arguments){
		count++;
		if (count > 5){
			System.out.println("Giving up after many tries!");
			return null;
		}
		Object result=null;
		try {
			Method method = getMethod(methodName);
			Object res =  method.invoke(askPort, arguments);
			Method error = res.getClass().getMethod("getError");
			if ( (Integer)error.invoke(res) == 101){
				this.startSession();
				res = method.invoke(askPort, arguments);
			}
			return res;
		} catch (IllegalArgumentException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (InvocationTargetException e) {
			if (e.getCause().getCause().getClass().getName().equals("java.net.SocketTimeoutException")){
				System.out.println("Timeout, re-trying:"+count);
				return wrapper(count,methodName,arguments);
			} else {
				e.printStackTrace();
			}
		} catch (SecurityException e) {
			e.printStackTrace();
		} catch (NoSuchMethodException e) {
			e.printStackTrace();
		}
		return result;
	}
