resolved memory leaks