fixed an error in case of somehow deleting apikeys from a user