handle socket err