fix errant `end` in the wrong spot
fix broken sync