validate email and validate name functions