emit and send messages