cleanup connection correctly + report errors to sentry when syncing