bug fix : fixed issues in the new sendData method