implementing sendMessages