added a validator to make sure both fields are filled