Fix bug where connect object is unavailable