re-implement addLayersFromFile