add better handling of Proxy lifecycle