Fixed bug: crash when exiting previews with escape