fix retarget calculation