Added gui handling support