fixes crashes if no deck is selected when closing #212