fixed bug in envir