or even better
```
hwname = ""
hwname = res_list.first["name"] || "" if res_list.first
```
and can skip above code for res