Changed hook to socket class