Changed to protect against missing  when checking for file uploads