Found the issue! It was a problem with how I was passing in the parameter after all. I used a closure instead and now its working fine.
Thanks for all your help Brent!
      
    Found the issue! It was a problem with how I was passing in the parameter after all. I used a closure instead and now its working fine.
Thanks for all your help Brent!