NXP-13315 fix NPE and bad invalidation