fix hanging on socket