fixes issue of model re-rendering and losing new messages