Moved connection to be global so it is persistent