Fix index function

I found a bug in the `index` method. The argument is `index`, but `this.app.stack[i].handle` was returned.