correcting sync_server and sync_local logic