added reg validation