fix bug hasClass now uses RegExp