The double-edged sword of foreign investment