fix error when file field was not required