added entity removal and invalidation support