invalidate keys properly