Avoiding this middle-income trap