better solution of invalidate