change the position of the code to take care of a BOM