update devices and exit code