join to document socket logic