before changing UI...