removed wrong calls to hasClass. Fixes #697