aggregate warnings and show error message for duplicate variable names