Updated deprecated call to Apps.addToEnvironment