Added backbone of sendMessage function