Solved the bug that appeared by attempting to remove the last message.