connection manager. closes #1