improved shared_container error handling