ad function of message