added option to limit of number of files to be checked in one batch