added a max files threshold