Added back button and refresh protection for when logged in.