fix bug when invoking the plug in on different context