fix another potential segmentation fault