correct the gui error and fix the layout