failedFile is never used. Remove where its called.