Sort customVars and remove duplicate