handle errors for name functions