small changes on loadFromFile