fixed wagn/environment bug