Fix hasClass method