added sending message function