fix some bugs in UI