improved auto env activation/deactivation