Replace .getIndex() with .equals(). Fairly obvious, really.