database sync fixes