Smart release of corrosion inhibitors by a novel encapsulation method