added getConnection function