Fixed logout error with referencing keys