add wait till shutdown to repository ThreadSave