How to avoid painful memories