added autoenv support