add some validation for input