finalize message tag and output handling