Changed exception type
Minor change to ensure that there are no duplicate variable names.