fixed how environment vars were prepared