That would be because of what qwerty described, simply change the inc %Count line to else inc %Count so that it will only be incremented if a file wasn't unloaded.