Fixed a problem with 'this' scope