throw exception if name is empty