validation hook