Replace deprecated connection method