better error handler for socket.io