bugfix - actually limit the number of files