Added method to validate name