added javascript validation