bug fix in numEncode