added code to fix env