updated onProduction to be more consistent with other code