fix some bugs and UI Implementation