add typeValidator- not finished
typeValidator