fixed large sync bug
made it much more robust