Fix to editor onbeforeunload