Added an extra check for duplicate fields in a file

Throws a BadInputFile exception for duplicate fields