Changed the order of server shutdown to have more chance the storages are closed