implemented global plugin close