put adding env safety into a function. Appending States if the initial env and sys is different from spec