update: fixed memory leak