fixed memory leak
dont like this