Fix to JS validation