fixed prevPath initialization