wip
revise beforeunload