APP-242 updated handling of env failure flag