end loading ui function