adding invalidate method