message-handler: save state