Modify getKey implementation