bugfixes (memory leak)