fixed bugs in the gui