fix environment inherit in subprocess