fix some bugs for UI