So, this would mean one of two things, (a) due to the nature of the logic an echo is required and the fix that I have stated above (i.e. clearing the output buffer) or (b) there is a bug somewhere in the output buffering logic that needs to be fixed to make this work different and therefore output the proper ordering of content without the echo.