updated detect environment settings