fixed #67 and the empty beforeunload message