Solved possible memory leak