fix for maxFileCount, if any error in the upload