fixed problems with duplicate messages / message persistence