fixed breaking spec in beforeunload -> unload