Corrected global refs to UI elements

now all locally defined