Fix sync feature freezing the program #84

This commit completes the sync function, but now the sync function
needs to be run in the background.