Fix scope of dataConn variable