Fixed bug that caused messages to be shown twice