fixed memeory leak