Finally found and fix the socket crash