added sendMsg function, and fixed scope issues so that the conversations get updated with incoming messages