eliminated some mem leaks
fixed leaks