add log and refine example