improve PATH handling