fix removal of key on logout