fixed segfault when listing many devices