Fix issue cannot close entity store