loadFromFile does not work as intended