fix calculate.env