changed datalen uchar* to uchar