wrapped send into a function