Make sure we are inside a run loop before syncing
Merge pull request #2839 from teddyzeenny/sync

Make sure we are inside a run loop before syncing