Check validity of names