fix session instances_ids_cache bug.