memory leaks seems to be solved