pdf batch naming not running in sequence.

Below is the code for a script to rename pdf files in sequencial numerical order. The script is a App, working by dropping a selection of pdf files onto it to initiate. The problem with the script is that sometimes (ie. not always), the script will start numbering with the 2nd file in the list of selected files, leaving the 1st file in the list until the last. The end result being the pdf numbers out of order. (The pdf files in my case are already numbered eg. 1 -10, but my client required that they by numbered as per id numbers in the file. Eg. 2100 - 2109). Why is the script starting with the 2nd file?? Would there be any benefit in writing a script to process a folder as opposed to individual files? I have not tried this but I would be happy to try if this will resolve the problem.

global pdfname
global origname
global timedelay
pdfstart as number


on open fileList
	display dialog "What number do you to start at?" default answer ""
	set pdfstart to text returned of result
	repeat with aFile in fileList
		tell application "Finder"
			activate
			set origname to name of aFile
			select aFile
			set name of aFile to (pdfstart as string) & ".pdf"
			set pdfstart to pdfstart + 1
		end tell
	end repeat
end open

You don’t receive an alphabetically ordered list when you drop files in a droplet. So, you may order this list before processing it (renaming items). Here is a quick routine I snagged somewhere with a little adaptation:

on open alias_list
	set alias_list to selectionSort(alias_list)
end open

on selectionSort(sortItems)
	set j to sortItems's length
	repeat while j is greater than 1
		set targetIndex to j
		set j to j - 1
		repeat with i from 1 to j
			if ((item i of sortItems as text) > (item targetIndex of sortItems as text)) then set targetIndex to i
		end repeat
		if (targetIndex is less than or equal to j) then
			set tempVar to (item targetIndex of sortItems)
			set (item targetIndex of sortItems) to (item (j + 1) of sortItems)
			set (item (j + 1) of sortItems) to tempVar
		end if
	end repeat
	return sortItems
end selectionSort