fixed bug with the new socket being overwritten