fixed refresh and resize in gui