Keybindings System

I have a simple Keybinding setup in my game that already Adds/removes keys as the user assigns them and I was trying to set it up so that, if the user chooses a key that is already assigned to another action, it will bind that same key to the new action and unbind it from the previous one. I’ve been trying some stuff here, but I couldn’t get the reference to the old assignment, and therefore remove it. Any ideas?