Add checking for dumping messages to the db-file.