Need closure to capture method variable when defining method functions

I was playing around with this library, and noticed the `list` method worked as in your example, but other methods didn't. I think this fixes it!