Fixed alerts when user tries to leave the page.