BUG: store messages correctly