diff --git a/resources/templates/provision/polycom/4.x/{$mac}-directory.xml b/resources/templates/provision/polycom/4.x/{$mac}-directory.xml
index 682c175c05..be8909105f 100644
--- a/resources/templates/provision/polycom/4.x/{$mac}-directory.xml
+++ b/resources/templates/provision/polycom/4.x/{$mac}-directory.xml
@@ -1,7 +1,7 @@
-
+ {assign var=x value=1}
{foreach $contacts as $row}
-
{if $row.contact_name_given != ""}
@@ -15,7 +15,7 @@
{else}
{$row.phone_extension}
{/if}
- 1
+ {$x}
0
@@ -23,6 +23,7 @@
0
0
+ {assign var=x value=$x+1}
{/foreach}
\ No newline at end of file
diff --git a/resources/templates/provision/polycom/5.x/{$mac}-directory.xml b/resources/templates/provision/polycom/5.x/{$mac}-directory.xml
index 682c175c05..be8909105f 100644
--- a/resources/templates/provision/polycom/5.x/{$mac}-directory.xml
+++ b/resources/templates/provision/polycom/5.x/{$mac}-directory.xml
@@ -1,7 +1,7 @@
-
+ {assign var=x value=1}
{foreach $contacts as $row}
-
{if $row.contact_name_given != ""}
@@ -15,7 +15,7 @@
{else}
{$row.phone_extension}
{/if}
- 1
+ {$x}
0
@@ -23,6 +23,7 @@
0
0
+ {assign var=x value=$x+1}
{/foreach}
\ No newline at end of file