added a macro that runs on pgs root files