Made the updateView as a local function such that it doesn't get added

to global scope