fix display leaks thanks to valgrind