fixes #180 (memory leak)