fixed small logical inconsistency in sending messages.