Fixed errorchecking for when the file-upload failed