fixed some bugs in the gui