fix env errors
various fix