js validation fix