bug fix for path generation