Fix bug - reference undefined variable self