fixed the bug that prevented saving 2 consecutive messages