now the connector manages sessions in the right way: now connections are
closed correctly