Why I used local here is beyond me. Switch to using my scoped variables.