finished js validation