added Javascript validations