Fix function to properly pass the editKey