improved example_custom_client