wouldn't it be better to throw an exception for invalid names ?