add validation related functions.