Added option to pass existing connection