added a guard against the usage of invalid proxies