correct variable type to unsigned