fixed 'map' protocol bug. changed client sdk to be aware of message count