clear ui when setting main state