corrected sync function (in this version complete is right)