now using dict for handling message callbacks