update global env and fix tests