fixed a small bug in socketConnection