optimize unplug