rewrite getConnection