Brought over manually pull request to fix message history not getting removed