rename "str" variable to avoid confusion with the primitive type