fixing environment priority order