fix set value for distance at -1, not 0