fix bug #21757

by fixing up bad commit eb9274bd4c78a5f9a86bc9e0bf748f701d81e6b1.

the code to drop messages older than 5 should run inside the if block,
in the scenario when there were previous message, not outside it (!)