update detect environment logic
update configs