Fix recursive loop.
Write messages to disk.