fix double-free bug + v1.0.6