added a check to initialize the AppUI variable;