Fixed bugs of connection counter (after reading)