Optimization of sendMessage(), fixed old bug