fixed check for req.files, it can be an object not just array