added additional validation javascript