fix a few bugs in ui