Adding js validation