fix database sync when value is nil