Use do to capture variable