replace saveAs by save in savePageBeforeClose