Bug fix #6: Optimization about ui opertaiton