update getKey with mode