Fixed scope issue - could not reference this in classes