sort files before adding to handler list