clock sync: fix logic