fixed memory leak it seems