fix bugs and gui.