Fix a bug.

- Bug: TypeError: Object #<Object> has no method 'error'
- Fix: Bound callback function to the right context.