updated connection manager
added tests