Fix to prevent double loading of layers