Added confirmation for navigating away