moving where the proxy is created to after checking the config