This way we can ensure that it is set in the environment in time for the lua callback to see it. refs: #1776