Fixes a potential crash when moving messages