preferences were releasing memory on close