renamed sendMessage function to deliverMessage so it won't conflict with the