fixes to memory leaks due to circular references with widgets