Fix a bug of saving when concurrent operations happen.