fixed socket error handler
0.4.1