fixed envir bug