modified js validation