Fixed message flush issue