Fix connection retrieval due to mis-scoping