minor fix in memory leak fix