return the proper path even if the program has multiple children