socket checking improved