fixed bugs in method for building SFR file