add validation to input