pathlength bug fix