added js validation