Move this declaration up above line 21, since you reference it as the second arg to `Sync`.  Also, yes, you can assume that syncId will exist when this is invoked (i.e., it won't run this code until later).