bug fix. Verifying cache validation before saving