fixed crash with dead socket