fix potential memory leak
v1.0.1