nasty hack for memory writing issue in pdgels