add socket error debugging