Terminal Keeps Repeating Messages

This happens if I leave the application running in the background. After some minutes, bang! Messages are repeated.

If I complete close the app, and re-open it, then I see the messages I am expecting to see. In this case will be 4 messages. In my opinion, my code is not re-sending the messages. They will be with a different time, am I right?