fix bugs in the ui