get the order of environments correct