change the order of the select in the getconn function