let you specify a function to execute on sending stats