Add _validate function: input validation/conversion