fix the use of a connection as an argument if it exists