handle accidental closing of page, fixes #69