add setvalidate & validate method