removed  memory leaks