send data with a separate function, not in the constructor