fixup environment adding/removal