Fix bug in addClass helper to prevent applying classes muliple times