TODO: fix file field validation