Updated JS to work with validation now