make sure type is unsigned