added error throwing for loadFromFile when file was not loaded