Added in external state object and fixed uiviewcontroller state object