fix distance position check bug