Added uiLoop function.