Fix LS crash on close