fix environment bug