Using 'hasClass' instead of 'is'