Correctly iterate over the array to add local user entries.
Remove duplicate variable.