refactor to find connection where it should be