Update to socket events code