fix some of memleaks