fixed the overlapping problem in the GUI

requires test (have not tested that yet)