fixing problem created by making a variable unsigned