fixed call to hasClass in this.addClass to call function on scope