callback method for sendData implemented