fix memmory leak