How China can avoid the middle income trap