Text this: Mitigating memory effects during undulatory locomotion on hysteretic materials