Define validator before use