Validating the input