Anon function recursion by referencing the function variable in the correct scope