Fix problem with validation of document uploads