reformat recieving code & make it threadsafe
make #getMissedMessages public api