added js validation.