Bug fix (socket import) and add --hook command to add hook