Corrected problem with onbeforeunload event not being unbound when save button pressed