safe subtraction fixed