added thread gui support