check for cp key before it is deleted