fixed error getting connection from pool

@lvca this fixes a small oversight acquiring a connection from the pool, added unit test