Better error handling. All socket events now has a unique key to identify the socket