replace hard paths with discovered ones