fixed overflow error for uchar