fixed bug of multiple call of sockets