fixing issue where leave on beforeunload was not registered when notest is 1