jshint output: 'stack_id' used out of scope.

I'm not sure why it thinks that, it looks okay to me, but not sure I understand js scoping. Maybe it is confused because stack_id also exists at function scope? maybe best just to pick a clean name