memmory leak fix