using only onbeforeunload