bug fix for socket resuable