Bug fix using getKey