only create new connection when there are some invocation and close it immediately