fixed many bugs in the GUI