diff --git a/registry/scripts/registry.sh b/registry/scripts/registry.sh
index 9d9f0bea5402483323ad27427dbf4b8bfb165057..5bd730cff40f129a15302becac6c9dd4b9dabb59 100755
--- a/registry/scripts/registry.sh
+++ b/registry/scripts/registry.sh
@@ -43,9 +43,9 @@ do
     if [ $(echo "$line" | egrep -c "^([0-9a-f]{2}:?){6} .*$") -eq 1 ]
     then
         date=$(date +%Y%m%d)
-        res=$(grep "$line" $conf_file)
         rIP=$(echo $line | cut -d ' ' -f 3)
         line=$(echo $line | cut -d ' ' -f 1-2)
+        res=$(grep "$line" $conf_file)
         if [ ! -z "$res" ]
         then
             # Update