icon. add/removeClass only when found

In certain instances, the icon was not being found and javascript was throwing an error "cannot call method addClass/removeClass of undefined"