fix key deletion issue