diff --git a/src/pl/tcl/modules/pltcl_loadmod b/src/pl/tcl/modules/pltcl_loadmod
index d437f76b08b006dea6e01d4b3475b61a633120ad..615dc1c7552106f14e9bd9c309c54bcb3ee99b27 100755
--- a/src/pl/tcl/modules/pltcl_loadmod
+++ b/src/pl/tcl/modules/pltcl_loadmod
@@ -452,6 +452,7 @@ proc __PLTcl_loadmod_load_modules {conn} {
 	    	pg_exec $conn "insert into pltcl_modules values (	\
 			'$xname', $i, '$xpart')"			\
 	    ] -clear
+	    incr i
 	}
 
         pg_result [pg_exec $conn "commit;"] -clear