Use Function.prototype.bind() instead of var that = this construct.