fixed bug related to `attach_sockets`