added a validation on the input.