Fixing small bug in connection class