diff --git a/lib/get_GPU_GROUP.sh b/lib/get_GPU_GROUP.sh
index c20b4c5..109a147 100755
--- a/lib/get_GPU_GROUP.sh
+++ b/lib/get_GPU_GROUP.sh
@@ -33,7 +33,7 @@ To return to the previous page just press ENTER without typing in anything.
             local GPU_DEVID=$($SCRIPTDIR/utils/ls-iommu | grep -i "group $1" | perl -pe "s/.+\[([0-9a-f]{4}:[0-9a-f]{4})\].+/\1/" | perl -pe "s/\n/,/" | perl -pe "s/,$/\n/")
 
             # Get the PCI ids
-            local PCI_ID=$($SCRIPTDIR/utils/ls-iommu | grep -i "group $1" | cut -d " " -f 4 | perl -pe "s/\n/ /" | perl -pe "s/\s$//")
+            local PCI_ID=$($SCRIPTDIR/utils/ls-iommu | grep -i "group $1" | cut -d " " -f 4 | perl -pe "s/([0-9a-f]{2}:[0-9a-f]{2}.[0-9a-f]{1})\n/\"\1\" /" | perl -pe "s/\s$//")
 
             # Write the GPU_PCI_IDs to the config that quickemu might make use of in the future
             printf "GPU_PCI_ID=($PCI_ID)
@@ -61,4 +61,4 @@ function main () {
     get_GROUP $1
 }
 
-main $1
\ No newline at end of file
+main $1
diff --git a/lib/get_USB_CTL_GROUP.sh b/lib/get_USB_CTL_GROUP.sh
index 4ab9c87..ea7e59f 100755
--- a/lib/get_USB_CTL_GROUP.sh
+++ b/lib/get_USB_CTL_GROUP.sh
@@ -25,7 +25,7 @@ To return to the previous page just press ENTER.
     case "${YESNO}" in
         [Yy]*)
             # Get the PCI ids
-            local PCI_ID=$($SCRIPTDIR/utils/ls-iommu | grep -i "group $1" | cut -d " " -f 4 | perl -pe "s/\n/ /" | perl -pe "s/\s$//")
+            local PCI_ID=$($SCRIPTDIR/utils/ls-iommu | grep -i "group $1" | cut -d " " -f 4 | perl -pe "s/([0-9a-f]{2}:[0-9a-f]{2}.[0-9a-f]{1})\n/\"\1\" /" | perl -pe "s/\s$//")
 
             # Replace the blank USB_CTL_ID with the PCI_ID for the usb controller the user wants to pass through
             perl -pi -e "s/USB_CTL_ID=\(\)/USB_CTL_ID=\($PCI_ID\)/" "$SCRIPTDIR/$QUICKEMU/qemu-vfio_vars.conf"
@@ -43,4 +43,4 @@ function main () {
     get_USB_CTL_GROUP $1
 }
 
-main $1
\ No newline at end of file
+main $1