fixed some bugs in the ui