fix bug in leavesync