Fixing error in file field handling