Fixed so that the actual number of files is right