Fixed connection count issue