fixed issue when keycache is in inconsistent state