removed mem leaks