Model validation hook