Add input validating method