Fixed a bug that cancelled sync runs prematurely