Added gui redraw logic