Fix channel sync bug - global variables are bad