used newInstance widget to create validator instead of raw code