Added support for using a pre-exsiting connection