Remove the global conn variable. fixes #11831

This should have been removed before the previous pull request