extracting the GEM and fixing some paths