Fix bug caused by incorrect 'this' reference