Added javascript validation