Fix issue related to returnValue in BeforeUnloadEvent