Synchronous setting

Hi,
I am using compiled version of CARLA 0.9.8 in Windows.I am trying to use synchronous mode with below code but I am getting an error which is below:
def game_loop(args):
pygame.init()
pygame.font.init()
world = None

try:
    client = carla.Client(args.host, args.port)
    client.set_timeout(2.0)

    settings = client.get_world().get_settings()
    settings.synchronous_mode = True
    settings.fixed_delta_seconds = 0.05
    client.get_world().apply_settings(settings)

    display = pygame.display.set_mode(
        (args.width, args.height),
        pygame.HWSURFACE | pygame.DOUBLEBUF)

    hud = HUD(args.width, args.height)
    world = World(client.get_world(), hud, args)
    controller = KeyboardControl(world, args.autopilot)

    clock = pygame.time.Clock()
    while True:
        print(" to check sync", client.get_world().get_settings().synchronous_mode)
        clock.tick_busy_loop(60)
        if controller.parse_events(client, world, clock):
            return
        world.tick(clock)
        world.render(display)
        pygame.display.flip()

finally:

    if (world and world.recording_enabled):
        client.stop_recorder()

    if world is not None:
        world.destroy()

    pygame.quit()

Error:
rect = pygame.Rect((bar_h_offset, v_offset + 8), (f * bar_width, 6))
TypeError: Argument must be rect style object

I even tried like this:

    client.get_world().apply_settings(carla.WorldSettings(
        no_rendering_mode=False,
        synchronous_mode=True,
        fixed_delta_seconds=0.01))
    clock = pygame.time.Clock()

But the client window gets freeze and the car doesot move even applying the controls.
Please advise.

Today, I changed the argument to 1920*1080, I am getting black screen and nothing else.