add validation code and type