implement validation callbacks.