oops. Used ES6 by mistake
fixing this.getMode is not defined