fix gc issue
improve sample