fixed bug in hasClass