Fixed a glitch with addClass method