TC-999 - moving variable definition up so that is defined before its used.