Add connection to query