fixed shutdown routine which didn't persist dynamic data model