Added custom Exception handling for an invalid name