fixing length calculation on argv