fixed cast to uint