correcting first memory leak