production code v1.1

fixed memory leak