added hasClass function