Fixed memmory leak